﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace University.Workshop.Presentation.OTBData
{
    /// <summary>
    /// Interaction logic for RegisterOtbData.xaml
    /// </summary>
    public partial class RegisterOtbData : Page
    {
        public RegisterOtbData()
        {
            InitializeComponent();
        }

        private void managementTxt_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            managmentCld.Visibility = Visibility.Visible;
        }

        private void managementTxt_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
        {
            managmentCld.Visibility = Visibility.Hidden;
        }

        private void managmentCld_DisplayDateChanged(object sender, CalendarDateChangedEventArgs e)
        {
            if (managementTxt != null)
            {
                string year = managmentCld.DisplayDate.Year.ToString();
                string month = managmentCld.DisplayDate.Month.ToString();

                if (managmentCld.DisplayDate.Month < 10)
                    month = "0" + month;

                managementTxt.Text = string.Format("{0}-{1}", year, month);
            }
        }
    }
}
